﻿using _05.状态模式.Enums;
using _05.状态模式.States;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _05.状态模式.Factories
{
    /// <summary>
    /// 项目状态工厂
    /// </summary>
    internal class ProjectStateFactory
    {
        #region 获取当前项目状态对象 —— static ProjectState GetProjectState(ProjectStatus projectStatus)
        /// <summary>
        /// 获取当前项目状态对象
        /// </summary>
        /// <param name="projectStatus">项目状态枚举</param>
        /// <returns>项目状态对象</returns>
        public static ProjectState GetProjectState(ProjectStatus projectStatus)
        {
            switch (projectStatus)
            {
                case ProjectStatus.Discussing:
                    return ProjectState.DiscussingState;
                case ProjectStatus.Signed:
                    return ProjectState.SignedState;
                case ProjectStatus.Constructing:
                    return ProjectState.ConstructingState;
                case ProjectStatus.Complete:
                    return ProjectState.CompleteState;
                case ProjectStatus.Settled:
                    return ProjectState.SettledState;
                default:
                    throw new ApplicationException("值有误！");
            }
        } 
        #endregion
    }
}
